import Vue from 'vue';
import Router from 'vue-router';
import Home from './views/Home.vue';

Vue.use(Router);

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      redirect: '/home',
    },
    {
      path: '/home',
      name: 'home',
      meta: {
        title: '首页',
        tabbarShow: true,
      },
      component: () => import(/* webpackChunkName: "about" */ './views/Home.vue'),
    },
    {
      path: '/contact',
      name: 'contact',
      meta: {
        title: '联系我们',
        tabbarShow: true,
      },
      component: () => import(/* webpackChunkName: "about" */ './views/Contact.vue'),
    },
    {
      path: '/want',
      name: 'want',
      meta: {
        title: '我想租车',
        tabbarShow: true,
      },
      component: () => import(/* webpackChunkName: "about" */ './views/WantRentCar.vue'),
    },
    {
      path: '/about',
      name: 'about',
      meta: {
        title: '关于爱玖',
        tabbarShow: true,
      },
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
    },{
      path: '/info/:id',
      name: 'info',
      meta: {
        title: '详情',
      },
      component: () => import(/* webpackChunkName: "about" */ './views/CarInfo.vue'),
    },
  ],
});
